home *** CD-ROM | disk | FTP | other *** search
- /* SaveRange.thor · by Troels Walsted Hansen
- ** $VER: SaveRange.thor v1.30 (19.05.94)
- **
- ** Save a specified range of messages to disk.
- **
- ** New features: · "/" and ":" characters in confnames
- ** no longer causes trouble
- ** · won't ask for bbs and conf if a
- ** bbs is open and a conf is active
- */
-
- options results
-
- if(substr(address(),1,4) ~= "THOR") then do
- parse arg portname
- if~(show(p, portname)) then do
- if ~(show(p, "THOR.01")) then do
- say "No THOR port found!"
- exit
- end
- else portname = "THOR.01"
- end
- end
- else portname = address()
-
- address(portname)
-
- GETGLOBALCONFIG
- CURRENTBBS stem CURRENT
-
- if(CURRENT.BBSNAME ~= "" & CURRENT.CONFNAME ~= "") then do
- bbsname = CURRENT.BBSNAME
- confname = CURRENT.CONFNAME
- end
- else do
- REQUESTLIST BBSLIST
- bbsname = result
- if(rc ~= 0) then exit
-
- REQUESTLIST CONFLIST BBS '"'bbsname'"'
- confname = result
- if(rc ~= 0) then exit
- end
-
- GETCONFCONFIG bbs '"'bbsname'"' conf '"'confname'"' stem CONFIG
-
- REQUESTINTEGER MIN '"'CONFIG.FIRSTMSG'"' MAX '"'CONFIG.LASTMSG'"' INIT '"'CONFIG.FIRSTMSG'"' TITLE '"First message in range:"' BT '"_Ok|_Cancel"'
- firstmsg = result
- if(rc ~= 0 | firstmsg = "RESULT") then exit
-
- REQUESTINTEGER MIN '"'firstmsg'"' MAX '"'CONFIG.LASTMSG'"' INIT '"'CONFIG.LASTMSG'"' TITLE '"Last message in range:"' BT '"_Ok|_Cancel"'
- lastmsg = result
- if(rc ~= 0 | lastmsg = "RESULT") then exit
-
- REQUESTFILE TITLE '"Select directory for messages:"' ID '"'GLOBALCONFIG.SAVEDIR'"' FP PAT '"#?"'
- if(rc ~= 0|result = "") then exit
- else dir = result
-
- /* if user selected a file instead (silly user) reduce it to dirname */
-
- endchar = right(dir,1)
-
- if(endchar ~= ":" & endchar ~= "/") then do
- posi = lastpos("/",dir)
- if(posi = 0) then posi = lastpos(":",dir)
- dir = delstr(dir,posi+1)
- end
-
- if(pos("/",confname) ~= 0 | pos(":",confname) ~= 0) then
- newconfname = translate(confname,"..","/:")
- else newconfname = confname
-
- do i=firstmsg to lastmsg
- SAVEMESSAGE BBS '"'bbsname'"' CONF '"'confname'"' MSGNR i FILENAME '"'||dir||newconfname||'.'||i||'"'
- end
-
- exit
-